#include "print_unit.h"

#include "file_kit.h"
#ifdef OS_WIN32
#include <tchar.h>
#endif

CPPUNIT_TEST_SUITE_REGISTRATION( CPrintUnit );

#ifdef OS_LINUX
#define _tprintf printf
#endif

void CPrintUnit::PrintEnumFolder()
{
	wel::CFolder folder;
	wel::CFileItem FileItem;

	folder.FindFirst( FileItem, T("./") );
	printf("\n");
	for ( ; FileItem.IsValid(); FileItem++ )
	{
		_tprintf( T("FileName: %s\n"), FileItem.GetName().c_str() );
	}//end for

	printf("\nfilter:.cpp\n");
	if( folder.FindFirst( FileItem, T("./"), T("*.cpp") ) )
	{
		do 
		{
			_tprintf( T("FileName: %s\n"), FileItem.GetFullPath().c_str() );
		} while ( folder.FindNext(FileItem) );
	}
}
